#ifndef __IK_C_DOM_READER_H__
#define __IK_C_DOM_READER_H__

#include <Inklude/Inklude.h>
#include <Inklude/ikCString.h>
#include <string>
#include <functional>
#include <vector>

namespace Inklude
{
    class INKLUDE_CLASS_EXPORT ikCXmlDomReader
    {
    public:
        ikCXmlDomReader();
        ~ikCXmlDomReader();
        void Parse(const char* XmlFileName);
        unsigned int GetNumberOfTagElements(ikCString& TagName);
        void GetValue(ikCString& TagName, ikCString& AttributeName, ikCString& Value);
        void GetValue(ikCString& TagName, ikCString& AttributeName, int& Value);
        void GetValue(ikCString& TagName, ikCString& AttributeName, float& Value);
        // This function is very INEFFICIENT SLOW BAD but,,, convenient
        // Please use it at construction / destruction time
        // Please use it MAIN LOOP if you DON'T HATE slow application
        void for_each(ikCString& TagName, std::vector<ikCString> AttributesVec, std::function<void(std::vector<ikCString> )> func);

    protected:
        void _init();
        void _destroy();
        void* _getNodeList(ikCString& TagName);

    private:
        void* m_pParser;
        void* m_pErrorHandler;
    };
}


#endif // __IK_C_DOM_READER_H__

